package com.lujieni.consumer.controller;

import com.alibaba.csp.sentinel.annotation.SentinelResource;
import com.alibaba.csp.sentinel.slots.block.BlockException;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class SentinelController {

    @GetMapping(value = "/limit")
    @SentinelResource(value = "sayHello", blockHandler = "fallback")
    public String limit() {
        return "success1";
    }

    public String fallback(BlockException exception){
        return "fallback";
    }


}
